package com.uyayo.system.authority.service;

import java.util.List;

import com.uyayo.framework.common.exception.CodeMultipleException;
import com.uyayo.framework.common.exception.ParentNotFoundException;
import com.uyayo.framework.message.model.Result;
import com.uyayo.system.authority.entity.SysOrganization;
import com.uyayo.system.authority.entity.SysOrganizationResource;



public interface SysOrganizationService {

	List<SysOrganization> organizationTreeGrid(SysOrganization organization);

	List<SysOrganization> selectOrganizationAll(SysOrganization organization);

	SysOrganization selectOrganizationById(String orgId);

	/**
	 * 根据上级Id获取记录数
	 * @param parentId 上级id
	 * @return int
	 */
	int selectCountByParentId(String parentId);

	/**
	 * 保存
	 * @param sysOrganization 机构信息
	 * @throws CodeMultipleException 编码重复异常
	 * @throws ParentNotFoundException 父级不能发现异常
	 * @return int
	 */
	int saveOrganization(SysOrganization sysOrganization) throws CodeMultipleException, ParentNotFoundException;

	/**
	 *修改
	 * @param sysOrganization 机构信息
	 * @return int
	 * @throws CodeMultipleException 编码重复异常
	 * @throws ParentNotFoundException 父级不能发现异常
	 */
	int updateOrganization(SysOrganization sysOrganization) throws CodeMultipleException, ParentNotFoundException;

	/**
	 *
	 * @param id 机构id
	 * @return int
	 */
	int deleteOrganization(String id);

	List<SysOrganizationResource> findOrganizationResources(String organizationId);

	Result grantOrganizationResource(String ids,String organizationId);

	List<SysOrganization> findOrganizationByUserId(String userId);
}
